{% extends 'base.html' %}

{% block styles %}
  {{ super() }}
  <link href="{{ url_for_static('static', filename='plugins/jquery.fancytree/skin-win8/ui.fancytree.min.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='plugins/handsontable/handsontable.full.min.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='css/scene/scene.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='css/case/base.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='css/case/ssh.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='css/case/sql.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='css/case/http.css') }}" rel="stylesheet">
  <link href="{{ url_for_static('static', filename='css/tool/script.css') }}" rel="stylesheet">
{% endblock styles %}

{% block body_attribs %}
class="bg-gradient-grey"
{% endblock body_attribs %}

{% block app_content %}
<input type="text" class="form-control" id="input-module-id" value="{{ module.id }}" placeholder="" disabled style="display: none">

<div class="card shadow container-fluid p-0 mt-1">
  <div class="card-body p-0">
    <div class="row container-fluid pr-0 pl-0 mr-0 ml-0">
      <div class="col-6 input-group pr-0 pl-0">
        <div class="input-group-prepend">
          <label class="input-group-text" for="select-module">当前模块</label>
        </div>
        <select class="custom-select" id="select-module">
          {% for module_ in project.modules %}
            {% if module_.id == module.id %}
              <option value="{{ module_.id }}" selected>{{ module_.name }}({{ module_.id }})</option>
            {% else %}
              <option value="{{ module_.id }}">{{ module_.name }}({{ module_.id }})</option>
            {% endif %}
          {% endfor %}
        </select>
        <div class="input-group-append">
          <a class="btn btn-outline-secondary" role="button" href="{{ url_for('module.module', project_id=project.id ) }}">返回模块列表</a>
        </div>
      </div>
      <div class="col-3 input-group pr-0 pl-5">
        <input type="text" class="form-control" id="input-mark-text" placeholder="关键词搜索">
        <div class="input-group-append">
          <button class="btn btn-outline-secondary" id="btn-mark" type="button">查找</button>
          <button class="btn btn-outline-secondary" id="btn-clear-mark" type="button">重置</button>
        </div>
      </div>
      <div class="col-3 input-group d-flex justify-content-end pr-0 pl-0">
        <button class="btn btn-outline-success" id="btn-start-module-test" type="button" disabled="">
          执行测试
        </button>
        <button class="btn btn-outline-danger" id="btn-stop-module-test" type="button" disabled="">
          终止测试
        </button>
      </div>
    </div>
    <div class="row container-fluid div-container-scene pr-0 pl-0 mr-0 ml-0 mt-1">
    <div class="card container-fluid element-navigation pr-0 pl-0" id="scene-navigation" >
      {% include 'scene/_scene_navigation.html' %}
    </div>
    <div class="card container-fluid div-container-element pl-0 pr-0" id="div-container-element">
{#      <div class="embed-responsive div-embed-responsive-iframe-case">#}
{#        <iframe id="iframe-case" class = "embed-responsive-item" src="" allowfullscreen></iframe>#}
{#      </div>#}
      {% include 'main/blank.html' %}
      <div class="d-flex justify-content-center align-items-center h-100" id="element-data-load-spinner">
        <div class="spinner-border text-primary m-5" role="status">
          <span class="sr-only">加载中Loading...</span>
        </div>
      </div>
    </div>
  </div>
  </div>
</div>

<div class="modal fade" id="modal-element-copy-tree" tabindex="-1" role="dialog">
  <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">从指定项目选择案例</h5>
        <small class="text-danger text-center">
          （注意：新复制生成的案例是乱序状态，请手动拖动案例组件调整执行顺序）<br>
          （注意：勾选逻辑控制器时，会连带将该逻辑控制器内的所有组件一起复制）
        </small>
        <button type="button" class="close" data-dismiss="modal">
          <span>&times;</span>
        </button>
      </div>
      <div class="modal-body p-1">
        <div class="input-group input-group-sm">
          <div class="input-group-prepend">
            <label class="input-group-text" for="select-project">当前项目</label>
          </div>
          <select class="custom-select" id="select-project">
            {% for project_ in projects %}
              {% if project_.id == project.id %}
                <option value="{{ project_.id }}" selected>{{ project_.name }}({{ project_.id }})</option>
              {% else %}
                <option value="{{ project_.id }}">{{ project_.name }}({{ project_.id }})</option>
              {% endif %}
            {% endfor %}
          </select>
        </div>
        <div class="container-fluid element-copy-tree pre-scrollable" id="element-copy-tree"></div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
        <button id="btn-element-copy" type="button" class="btn btn-primary" data-scene-id="">确定</button>
      </div>
    </div>
  </div>
</div>
{% endblock %}


{% block scripts %}
  {{ super() }}
  <script src="{{ url_for_static('static', filename='plugins/Sortable/Sortable.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/split.js/split.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/jquery.fancytree/jquery.fancytree-all-deps.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/jquery.fancytree/modules/jquery.fancytree.filter.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/Inputmask/jquery.inputmask.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/jQuery-Mask-Plugin/jquery.mask.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/handsontable/handsontable.full.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/handsontable/languages/all.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/ace/ace.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/js-beautify/beautify.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/js-beautify/beautify-css.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/js-beautify/beautify-html.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/download/download.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='plugins/mark.js/jquery.mark.min.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/scene/scene.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/scene/scene_setting.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/logic_controller/if.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/logic_controller/loop.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/logic_controller/simple.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/logic_controller/while.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/case/base.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/case/ssh.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/case/sql.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/case/http/http.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/case/http/_cookies_manager.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/case/debug.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/tool/timer.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/tool/script.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/tool/variable_definition.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/tool/http_header_manager.js') }}"></script>
  <script src="{{ url_for_static('static', filename='js/tool/http_cookie_manager.js') }}"></script>
  <script>
    let project_id = {{ project.id }};
  </script>
{% endblock %}